<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'order.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
	<!-- //Custom Theme files -->
	<link href="shop-css/bootstrap.css" type="text/css" rel="stylesheet" media="all">
	<link href="shop-css/style.css" type="text/css" rel="stylesheet" media="all">
	<link href="shop-css/form.css" rel="stylesheet" type="text/css" media="all" />
	<!-- js -->
	<script src="shop-js/jquery.min.js"></script>
	<script type="text/javascript" src="shop-js/bootstrap-3.1.1.min.js"></script>
	<!-- //js -->
	<!-- the jScrollPane script -->
	<script type="text/javascript" src="shop-js/jquery.jscrollpane.min.js"></script>
			<script type="text/javascript" id="sourcecode">
				$(function()
				{
					$('.scroll-pane').jScrollPane();
				});
			</script>
	<!-- //the jScrollPane script -->
	<script type="text/javascript" src="shop-js/jquery.mousewheel.js"></script>
	<!-- the mousewheel plugin -->		

  </head>
  <script type="text/javascript">
	function showconfirmDialog(){
      if(${requestScope.msg eq null }){
      	
      }else
      	confirm("${requestScope.msg}")
      	
    }

  </script>
<!-- onload="getAllBooks()" -->
 
  <body onload="showconfirmDialog()">
   <!--header-->
	<div class="header">
		<div class="container">
			<nav class="navbar navbar-default" role="navigation">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
						<span class="sr-only"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</button>
					<h1 class="navbar-brand"><a href="shop.jsp">总店订餐系统</a></h1>
				</div>
				<!--navbar-header-->
				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">
						<li><a href="shop.jsp" class="active">首页</a></li>
						<li><a href="AllGoods_Servlet" class="dropdown-toggle">订餐</a></li>
						<li><a href="ToOrderView_Servlet" class="dropdown-toggle">我的订单</a></li>
								
					</ul> 
					<!--/.navbar-collapse-->
				</div>
				<!--//navbar-header-->
			</nav>
			<div class="header-info">
				<div class="header-right login">
					<span class="glyphicon glyphicon-user" aria-hidden="true"></span>
					<div id="loginBox">  
						
						<c:if test="${sessionScope.IsLogin eq 'Y'}">
						<form id="loginForm">
							<fieldset id="body">
								<fieldset>
									<label for="email">当前用户：${sessionScope.UserName}</label>
								</fieldset>
							</fieldset>
							<span><a href="Logout_Servlet">注销登录</a></span></p>
						</form>
						</c:if>
						
						<c:if test="${sessionScope.IsLogin eq 'N' || sessionScope.IsLogin eq null}">
						<form id="loginForm" method="post" action="Login_Servlet">
							<fieldset id="body">
								<fieldset>
									<label for="email">手机号</label>
									<input type="text" name="phone" id="email">
								</fieldset>
								<fieldset>
									<label for="password">密码</label>
									<input type="password" name="password" id="password">
								</fieldset>
								<input type="submit" id="login" value="登   录">
								<label for="checkbox"><input type="checkbox" id="checkbox"> <i>记住我</i></label>
							</fieldset>
							<p>新用户 ? <a class="sign" href="register.jsp">注册</a> <span><a href="res.jsp">忘记密码</a></span></p>
						</form>
						</c:if>
					</div>
				</div>
				<div class="header-right cart">
					<span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span>
					<c:if test="${sessionScope.IsLogin eq 'Y'}">
					<div class="cart-box">
						<h4><a href="checkout.html">
							<span class="simpleCart_total"> ￥0.00 </span> (<span id="simpleCart_quantity" class="simpleCart_quantity"> 0 </span>) 
						</a></h4>
						<p><a href="EmptyCart_Servlet" class="simpleCart_empty">清空 购物车</a></p>
						<p><a href="DoCart_Servlet" class="simpleCart_empty">结算 购物车</a></p>
						<div class="clearfix"> </div>
					</div>
					</c:if>
				</div>
				<div class="clearfix"> </div>
			</div>
			<div class="clearfix"> </div>
		</div>
	</div>
	<!--//header-->
  <!--products-->
	<div class="products">	 
		<div class="container">
			<h2>今	日	菜	品</h2>
			<div class="col-md-9 product-model-sec">
			<c:forEach items="${requestScope.goods}" var="good" varStatus="name">
				<div class="product-grid">
						<div class="more-product"><span> </span></div>						
						<div class="product-img b-link-stripe b-animate-go  thickbox">
							<img src="shop-images/${good.url}.jpg" class="img-responsive" alt="">
						</div>	
					<div class="product-info simpleCart_shelfItem">
						<div class="product-info-cust prt_name">
							<h4>${good.name}</h4>								
							<span class="item_price">$${good.price }</span>
							<span class="item_price">库存：${good.stock }</span>
							<form method="post" action="AddGood_Servlet">
							<input type="text" class="item_quantity" value="1" name="num"/>
							<input type="hidden" name="name" value="${good.name}">
							<c:if test="${good.stock eq '0'}">
							<input type="submit" class="item_add items" value="添加" disabled="disabled" style="color: white;background: gray"/>
							</c:if>
							<c:if test="${good.stock ne '0'}">
							<input type="submit" class="item_add items" value="添加">
							</c:if>
							</form>
							<div class="clearfix"> </div>
						</div>												
					</div>
				</div>
			</c:forEach>
			</div>	
			<div class="col-md-3 rsidebar span_1_of_left">
				<section  class="sky-form">
					<div class="product_right">
						<h4 class="m_2"><span class="glyphicon glyphicon-minus" aria-hidden="true"></span>种类</h4>
						<div class="tab1">
							<ul class="place">								
								<li class="sort">素</li>
								<li class="by"><span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span></li>								
							</ul>
							<div class="clearfix"> </div>
							<div class="single-bottom">						
								<a href="TypeGoods_Servlet?type=素"><p>素</p></a>
						    </div>
					    </div>						  
						<div class="tab2">
							<ul class="place">								
								<li class="sort">荤</li>
								<li class="by"><span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span></li>
							</ul>
							<div class="clearfix"> </div>
							<div class="single-bottom">						
								<a href="TypeGoods_Servlet?type=荤"><p>荤</p></a>							
						    </div>
					    </div>
					    <div class="tab3">
							<ul class="place">								
								<li class="sort">小吃</li>
								<li class="by"><span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span></li>
							</ul>
							<div class="clearfix"> </div>
							<div class="single-bottom">						
								<a href="TypeGoods_Servlet?type=小吃"><p>小吃</p></a>							
						    </div>
					    </div>
						<div class="tab4">
							<ul class="place">								
								<li class="sort">酒水</li>
								<li class="by"><span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span></li>
							</ul>
							<div class="clearfix"> </div>
							<div class="single-bottom">						
								<a href="TypeGoods_Servlet?type=酒"><p>酒水</p></a>
								<a href="TypeGoods_Servlet?type=饮料"><p>饮料</p></a>
						    </div>
					    </div>
						<div class="tab5">
							<ul class="place">								
								<li class="sort">锅底</li>
								<li class="by"><span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span></li>
							</ul>
							<div class="clearfix"> </div>
							<div class="single-bottom">						
								<a href="TypeGoods_Servlet?type=清汤"><p>清汤</p></a>
								<a href="TypeGoods_Servlet?type=红汤"><p>红汤</p></a>
								<a href="TypeGoods_Servlet?type=鸳鸯"><p>鸳鸯</p></a>
						    </div>
					    </div>
						<!--script-->
						<script>
							$(document).ready(function(){
								$(".tab1 .single-bottom").hide();
								$(".tab2 .single-bottom").hide();
								$(".tab3 .single-bottom").hide();
								$(".tab4 .single-bottom").hide();
								$(".tab5 .single-bottom").hide();
								
								$(".tab1 ul").click(function(){
									$(".tab1 .single-bottom").slideToggle(300);
									$(".tab2 .single-bottom").hide();
									$(".tab3 .single-bottom").hide();
									$(".tab4 .single-bottom").hide();
									$(".tab5 .single-bottom").hide();
								})
								$(".tab2 ul").click(function(){
									$(".tab2 .single-bottom").slideToggle(300);
									$(".tab1 .single-bottom").hide();
									$(".tab3 .single-bottom").hide();
									$(".tab4 .single-bottom").hide();
									$(".tab5 .single-bottom").hide();
								})
								$(".tab3 ul").click(function(){
									$(".tab3 .single-bottom").slideToggle(300);
									$(".tab4 .single-bottom").hide();
									$(".tab5 .single-bottom").hide();
									$(".tab2 .single-bottom").hide();
									$(".tab1 .single-bottom").hide();
								})
								$(".tab4 ul").click(function(){
									$(".tab4 .single-bottom").slideToggle(300);
									$(".tab5 .single-bottom").hide();
									$(".tab3 .single-bottom").hide();
									$(".tab2 .single-bottom").hide();
									$(".tab1 .single-bottom").hide();
								})
								$(".tab5 ul").click(function(){
									$(".tab5 .single-bottom").slideToggle(300);
									$(".tab4 .single-bottom").hide();
									$(".tab3 .single-bottom").hide();
									$(".tab2 .single-bottom").hide();
									$(".tab1 .single-bottom").hide();
								})
							});
								
						</script>
						<!--//script -->	
					</div>
				</section>
			</div>
			<div class="clearfix"> </div>
		</div>
	</div>
	<!--//products-->
	<div class="footer-bottom">
		<div class="container">
			<p>© 2023 Time Travel</p>
		</div>
	</div>
</body>
</html>